﻿<%@ Page Title="Invoices" Theme="POSSystem" Language="C#" MasterPageFile="~/EditPages/Popup.Master" AutoEventWireup="true" CodeBehind="InvoiceViewer.aspx.cs" Inherits="WebUI.EditPages.InvocieViewer" %>

<%@ Register Src="~/Controls/POSControls/InvoiceListCtrl.ascx" TagName="InvoiceListCtrl" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PopupHeadHolder" runat="server">
    <script type="text/javascript">
        function printClose() {
//            document.getElementById('divToolBar').style.display = 'none';
//            document.getElementById('divStatusBar').style.display = 'none';
            window.print(); 
            //window.close();
            return false;
        }

        function confirmRevert() {
            try{
                var id = getSelectedItemID<%= invoiceList.ClientID %>();
                document.getElementById("<%= hidSelectedID.ClientID %>").value = id;
            }catch(ex){return false;}
            

            return confirm("Do you want to revert this invoice?");
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PopupToolbarHolder" runat="server">
    <table class="popuptoolbar" width="100%">
        <tr>
            <td style="vertical-align:middle; text-align:left; width:125px">
                <asp:LinkButton class="tbbutton" ID="btnRedo" ToolTip="Revert Invoice" runat="server" 
                    OnClientClick="return confirmRevert();" OnClick="btnRedo_OnClick" >
                    <img id="Img1" src="~/Images/Redo.png" runat="server" alt="" />
                    <asp:Label ID="label1" runat="server" Text="Revert Invoice"></asp:Label>
                </asp:LinkButton>
                
                <img src="../Images/tbSep.png" />
            </td>
            <td style="vertical-align:middle; text-align:left">
                <asp:Panel runat="server" DefaultButton="btnSearch">
                    <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
                    <asp:LinkButton class="tbbutton" ID="btnSearch" runat="server" OnClick="btnSearch_OnClick">
                        <img src="../Images/search.png" /><asp:Label ID="label2" runat="server" Text="Search"></asp:Label>
                    </asp:LinkButton>
                    <asp:LinkButton Visible="false" class="tbbutton" ID="btnPaymentHistory" runat="server" OnClick="btnUnpaid_OnClick" >
                        <img src="Images/unchecked.png" /><asp:Label ID="label12" runat="server" Text="Unpaid Only"></asp:Label>
                    </asp:LinkButton>
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PopupContentHolder" runat="server">
    <uc:InvoiceListCtrl ID="invoiceList" runat="server" AllowPaging="true" AllowSelecting="true" AllowSorting="true"
     PageSize="10" CssClass="" GridBorder="Solid" GridBorderColor="Black" GridLineStyle="Both" Width="100%"/>
    <asp:HiddenField ID="hidSelectedID" runat="server" />
</asp:Content>